from selenium import webdriver
from selenium.webdriver import DesiredCapabilities



class Test_Login:

    def setup(self):

        self.hub = "http://127.0.0.1:4444/wd/hub"
        self.caps = [DesiredCapabilities.CHROME.copy(), DesiredCapabilities.INTERNETEXPLORER.copy()]


    def test_search(self):

        for c in self.caps:
            try:
                self.baidu(webdriver.Remote(self.hub, c))

            except Exception as e:
                pass

    def baidu(self, driver):

        driver.maximize_window()
        driver.implicitly_wait(30)
        driver.get("http://www.baidu.com")
        driver.find_element_by_id("kw").send_keys("test")
        driver.find_element_by_id("su").click()




